﻿using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace ImoviesBlazorAntPro.Shared.Entities
{
    public class Movie
    {
        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.None)]
        public string Id { get; set; }

        [Required]
        [StringLength(100)]
        public string Name { get; set; }

        [Required]
        public string Url { get; set; }

        [Required]
        public string Category { get; set; }

        [Required]
        public string Region { get; set; }

        [Required]
        [Range(1990, 2038)]
        public uint Year { get; set; }

        [Required]
        public string Actors { get; set; }

        [Required]
        public string Director { get; set; }

        [Required]
        public string Intro { get; set; } = "暂无";

        public string Img { get; set; } = string.Empty;

        [StringLength(1024)]
        public string Comment { get; set; } = "暂无";
        public Movie(string id, string name, string url, string category, string region, uint year, string actors, string director, string intro, string img, string comment)
        {
            Id = id;
            Name = name;
            Url = url;
            Category = category;
            Region = region;
            Year = year;
            Actors = actors;
            Director = director;
            Intro = intro;
            Img = img;
            Comment = comment;
        }
    }
}
